<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    //
    protected $table = 'comment';

    public $timestamps = false;

    /**
     * 获取关联到该留言的用户
     */
    public function user()
    {
        return $this->hasOne('App\User', 'id', 'uid');
    }

    public function getComments()
    {
        return $self::orderBy('create_time', 'desc')->paginate(10);
    }
}
